import request from "../utils/hrRequest";

//获取管理的所有职位
export const getAllPosApi = (title, positionType, status, currentPage, pageSize) => {
  return request.get(`/hr/positions?title=${title}&positionType=${positionType}&status=${status}&currentPage=${currentPage}&pageSize=${pageSize}`)
}

//添加职位
export const savePosApi = (data) => request.post('/hr/positions', data)

//查询是否已经是好友
export const isContactApi = (id) => request.get(`/hr/messages/isContact/${id}`)

//查询联系人
export const getContactApi = (id) => request.get(`/hr/messages/${id}`)

//查询历史聊天信息
export const getHistoryMsgApi = (id) => request.get(`/hr/messages?id=${id}`)

//批量删除
export const deletePosApi = (ids) => request.delete(`/hr/positions?ids=${ids}`)

//查询hr是否关联了企业
export const isRelatedApi = () => request.get('/hr/users/isRelated')

//根据id查询职位详情
export const getPosByIdApi = (id) => request.get(`/hr/positions/${id}`)

//修改职位
export const updatePosApi = (data) => request.put(`/hr/positions`, data)

// 查询职位名称
export const getPosNameApi = () => request.get('/hr/positions/names')
// 查询简历
export const getResumeApi = ( posId, isView, createTime, currentPage, pageSize ) => {
  return request.get(`/hr/resumes?posId=${posId}&isView=${isView}&createTime=${createTime}&currentPage=${currentPage}&pageSize=${pageSize}`)
}
// 通过简历id查询简历详情
export const getResumeDetailApi = (id) => request.get(`/hr/resumes/${id}`)

//修改密码
export const updatePwdApi = (oldPwd, newPwd) => request.put(`/hr/users/pwd?oldPwd=${oldPwd}&newPwd=${newPwd}`)
